Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Nov 4, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing the CUSTOM_CHAIN_MAP and convertLegacyChain functionalities, making them exportable for testing. It also adds new test cases to validate chain properties and conversions.

Detailed summary

  • Changed CUSTOM_CHAIN_MAP to be exported for testing.
  • Exported convertLegacyChain function for internal use.
  • Added a legacyChain object representing Ethereum Mainnet.
  • Introduced multiple test cases for chain properties and conversions.
  • Verified caching of chains using CUSTOM_CHAIN_MAP.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2024

⚠️ No Changeset found

Latest commit: c63fefd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 4, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@vercel
Copy link

vercel bot commented Nov 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:55am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:55am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:55am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 1:55am

@kien-ngo kien-ngo marked this pull request as ready for review November 4, 2024 15:41
Copy link
Contributor Author

kien-ngo commented Nov 4, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kien-ngo and the rest of your teammates on Graphite Graphite

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 860 ms (0%) 621 ms (+56.88% 🔺) 1.5 s
thirdweb (cjs) 102.98 KB (-0.04% 🔽) 2.1 s (-0.04% 🔽) 1.1 s (+15.25% 🔺) 3.1 s
thirdweb (minimal + tree-shaking) 4.85 KB (0%) 97 ms (0%) 106 ms (+437.66% 🔺) 203 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 75 ms (+961.71% 🔺) 85 ms
thirdweb/react (minimal + tree-shaking) 17.57 KB (0%) 352 ms (0%) 260 ms (+398.97% 🔺) 611 ms

Copy link
Contributor

@gregfromstl gregfromstl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tests are just failing

@gregfromstl gregfromstl enabled auto-merge (squash) November 4, 2024 20:02
@gregfromstl gregfromstl disabled auto-merge November 4, 2024 20:03
@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 4, 2024
Copy link
Contributor

gregfromstl commented Nov 4, 2024

Merge activity

  • Nov 4, 3:05 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 4, 8:38 PM EST: A user added this pull request to the Graphite merge queue.
  • Nov 4, 8:55 PM EST: A user merged this pull request with the Graphite merge queue.

@kien-ngo kien-ngo force-pushed the kien/tests-for-chains branch from 2f5b66f to d014c1b Compare November 5, 2024 01:16
@codecov
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.55%. Comparing base (f98059c) to head (c63fefd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5280      +/-   ##
==========================================
+ Coverage   45.47%   45.55%   +0.08%     
==========================================
  Files        1067     1068       +1     
  Lines       55486    55514      +28     
  Branches     4013     4029      +16     
==========================================
+ Hits        25230    25292      +62     
+ Misses      29565    29532      -33     
+ Partials      691      690       -1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f98059c
packages 40.65% <100.00%> (+0.11%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/thirdweb/src/chains/utils.ts 84.34% <100.00%> (+26.08%) ⬆️

... and 2 files with indirect coverage changes

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR enhances the `CUSTOM_CHAIN_MAP` and `convertLegacyChain` function to be exported for testing purposes. It also adds new tests for chain handling, including legacy chain conversion and caching functionality.

### Detailed summary
- Exported `CUSTOM_CHAIN_MAP` for testing.
- Exported `convertLegacyChain` function.
- Added a `legacyChain` object for testing.
- Created tests for:
  - `getChainSymbol`
  - `getChainDecimals`
  - `getChainNativeCurrencyName`
  - `convertLegacyChain`
  - `defineChain` with a legacy chain.
  - Caching functionality with `cacheChains`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants